<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja">
  <head>
    <title>A canvas clearRect example</title>

    <script type="text/xaml" id="xaml"><?xml version="1.0"?>
      <Canvas xmlns="http://schemas.microsoft.com/client/2007"></Canvas></script>
<script type="text/javascript" src="../uupaa-excanvas.js"></script>

    <script>
    function boot() {
      document.body.style.backgroundColor = "#eee";
      document.getElementById('canvas').style.backgroundColor = "#008888";
      document.getElementById('vmlcanvas').style.backgroundColor = "#880088";
      draw(document.getElementById('canvas').getContext('2d'));
      draw(document.getElementById('vmlcanvas').getContext('2d'));
    }
    function draw(ctx){
      ctx.beginPath();
      ctx.fillStyle = "pink";
      ctx.arc(50, 50, 50, 0, Math.PI * 2, 1);
      ctx.fill();
      ctx.beginPath();

      ctx.fillStyle = "skyblue";
      ctx.arc(80, 80, 50, 0, Math.PI * 2, 1);
      ctx.fill();

      ctx.clearRect(20, 40, 60, 20);
    }
    </script>
    <style type="text/css">
      body { margin: 20px; font-family: arial,verdana,helvetica; background: #fff;}
      h1 { font-size: 140%; font-weight:normal; color: #036; border-bottom: 1px solid #ccc; }
      canvas { border: 2px solid #000; float: left; margin-right: 20px; margin-bottom: 20px; }
      pre { float:left; display:block; background: rgb(238,238,238); border: 1px dashed #666; padding: 15px 20px; margin: 0 0 10px 0; }
    </style>
  </head>

  <body onload="uuCanvas.ready(boot);">
    <h1>An example of <code>clearRect</code></h1>
    <div>
      <canvas id="canvas" width="150" height="150"></canvas>
      <canvas id="vmlcanvas" class="vml" width="150" height="150"></canvas>
<pre>
function boot() {
  document.body.style.backgroundColor = "#eee";
  document.getElementById('canvas').style.backgroundColor = "#008888";
  document.getElementById('vmlcanvas').style.backgroundColor = "#880088";
  draw(document.getElementById('canvas').getContext('2d'));
  draw(document.getElementById('vmlcanvas').getContext('2d'));
}
function draw(ctx){
  ctx.beginPath();
  ctx.fillStyle = "pink";
  ctx.arc(50, 50, 50, 0, Math.PI * 2, 1);
  ctx.fill();
  ctx.beginPath();

  ctx.fillStyle = "skyblue";
  ctx.arc(80, 80, 50, 0, Math.PI * 2, 1);
  ctx.fill();

  ctx.clearRect(20, 40, 60, 20);
}
</script>
</pre>
    </div>
  </body>

</html>
